﻿/*
 * Created by SharpDevelop.
 * User: bcrawford
 * Date: 5/13/2014
 * Time: 12:36 PM
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.ServiceProcess;
using RfiCoder;

namespace RfiCodingService
{
  [RunInstaller(true)]
  public class ProjectInstaller : Installer
  {
    private ServiceProcessInstaller rfiServiceProcessInstaller;
    
    private ServiceInstaller rfiServiceInstaller;
    
    private ServiceProcessInstaller rfiStarterProcessInstaller;
    
    private ServiceInstaller rfiStarterInstaller;
    
    public ProjectInstaller()
    {
      rfiServiceProcessInstaller = new ServiceProcessInstaller();
      
      rfiServiceInstaller = new ServiceInstaller();
      
      // Here you can set properties on serviceProcessInstaller or register event handlers
      rfiServiceProcessInstaller.Account = ServiceAccount.User;
      
      rfiServiceInstaller.StartType = ServiceStartMode.Automatic;
      
      rfiServiceInstaller.ServiceName = RfiCoder.RfiCoder.MyServiceName;
      
      rfiStarterProcessInstaller = new ServiceProcessInstaller();
      
      rfiStarterInstaller = new ServiceInstaller();
      
      rfiStarterProcessInstaller.Account = ServiceAccount.User;
      
      rfiStarterInstaller.StartType = ServiceStartMode.Automatic;
      
      rfiStarterInstaller.ServiceName = RfiServiceStarter.MyServiceName;
      
      this.Installers.AddRange( new Installer[] 
        { rfiStarterProcessInstaller, rfiStarterInstaller,  rfiServiceProcessInstaller, rfiServiceInstaller }
       );
    }
  }
}
